package com.ztc.ZtcApp.service;
import java.util.List;

import com.ztc.ZtcApp.dao.ZtcAppDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ztc.ZtcApp.bean.ZtcApp;

@Service("ZtcApp")
public class ZtcAppManager{
    @Autowired
	ZtcAppDao ztcAppDao;
	public String save(ZtcApp ztcApp) {
		return ztcAppDao.save(ztcApp);
	}

	/**
	 * 分页查询
	 * @param pageNumber 第几页
	 * @return app记录集合
	 */
	public List<ZtcApp> searchInfoLikes(String pageNumber) {
		List<ZtcApp> list = ztcAppDao.searchInfoLikes(pageNumber);
		return list;
	}

	/**
	 * 根据版本号查询app
	 * @param appVersion app版本号
	 * @return app记录集合
	 */
	public List<ZtcApp> searchToUpdate(String appVersion) {
		List<ZtcApp> list = ztcAppDao.searchToUpdate(appVersion);
		return list;
	}
	public List<ZtcApp> searchInfoEquals(ZtcApp ztcApp) {
		List<ZtcApp> list = ztcAppDao.searchInfoEquals(ztcApp);
		return list;
	}

	public String delete(String ztcAppId) {
		return ztcAppDao.delete(ztcAppId);
	}

	/**
	 * 获取app记录总条数
	 * @return app记录总条数
	 */
	public int getCount() {
		return ztcAppDao.getCount();
	}

	public String update(ZtcApp ztcApp) {
		return ztcAppDao.update(ztcApp);
	}

	/**
	 * 根据版本号排序获取app记录
	 * @return app记录集合
	 */
	public List<ZtcApp> getListOrderByVersion() {
		List<ZtcApp> list = ztcAppDao.getListOrderByVersion();
		return list;
	}
}
